//
// xorglib.h
//

/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301, USA.
 * 
 */

#ifndef __XORGLIB_H__
#define __XORGLIB_H__

#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <X11/keysym.h>
#include <X11/extensions/XTest.h>

#define FLAG_CTRL      0x01
#define FLAG_ALT       0x02
#define FLAG_SHIFT     0x04
#define FLAG_CAPSLOCK  0x08

#ifndef uchar
typedef unsigned char  uchar;
#endif
#ifndef uint
typedef unsigned int  uint;
#endif

class XOrgLib
{
public:
    XOrgLib();
    virtual ~XOrgLib();
    void    send_key_event_from_string(const char *key_str);
    void    send_key(KeySym keysym, uchar modflags);
    Window  get_destination_window();
    void    send_arrow_none_event();
    void    send_arrow_up_event();
    void    send_arrow_down_event();
    void    send_arrow_left_event();
    void    send_arrow_right_event();
    
protected:
    Display  *mp_display;
};

#endif // __XORGLIB_H__
